package com.pasu.breakreminder.utils;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;

import com.pasu.breakreminder.R;

public class DialogFactory {
    public static AlertDialog createSimpleDialog(Context context, String message, String buttonText, DialogInterface.OnClickListener buttonListener) {
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setMessage(message).setCancelable(true).setPositiveButton(buttonText, buttonListener);
        return builder.create();
    }

    public static AlertDialog createYesNoBackDialog(Context context, String message, DialogInterface.OnClickListener buttonYesListener,
            DialogInterface.OnClickListener buttonNoListener) {
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setMessage(message).setCancelable(true).setPositiveButton(context.getString(R.string.yes), buttonYesListener)
                .setNegativeButton(context.getString(R.string.no), buttonNoListener).setNeutralButton(context.getString(R.string.back), new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.cancel();
                    }
                });
        return builder.create();
    }
}
